content
directory.
.md
file and you will see something like
this:
netlify-cms-app
and gatsby-plugin-netlify-cms. Run the following command in the
terminal at the root of your
site:
config.yml
file in the directory structure you
see below:
config.yml
file paste the following
configuration:
gatsby-starter-blog.
gatsby-config.js.
/admin/
page and create a new post by clicking
New Blog. Add a title, a date and some
text. When you click Publish, a new
commit will be created in your GitHub
repo with this format Create Blog
“year-month-date-title”.
backend
field, and should be nested under that
field.
repo
github, gitlab, and bitbucket
backends; ignored by git-gateway. Follows the
pattern [org-or-username]/[repo-name].
branch
master
api_root
https://api.github.com
(GitHub), https://gitlab.com/api/v4
(GitLab), or https://api.bitbucket.org/2.0
(Bitbucket)
site_domain
location.hostname
(or cms.netlify.com
when on localhost)
site_id
query param sent to
the API endpoint.
Non-Netlify auth
setups will often
need to set this for
local development to
work properly.
base_url
https://api.netlify.com
(GitHub, Bitbucket)
or https://gitlab.com
(GitLab)
auth_endpoint
auth
(GitHub, Bitbucket)
or oauth/authorize
(GitLab)
base_url
for authentication
requests.
Optional.
cms_label_prefix
netlify-cms/
window.CMS
a global object that you can use to
register custom widgets, previews, and
editor plugins. The same object is
also the default export if you import
Netlify CMS as an npm module. The
available widget extension methods
are:
registerWidget
requires you to provide a React
component. If you have a build process
in place for your project, it is
possible to integrate with this build
process.
registerWidget
name
string
widget
property in
config
control
React.Component
or string
preview]
React.Component, optional
schema]
JSON Schema
object, optional
admin/index.html
admin/config.yml
registerEditorComponent
required
and pattern
options.
isValid
method to perform custom validations,
in addition to presence and pattern.
The isValid
method will be automatically called,
and it can return either a boolean
value, an object with an error message
or a promise. Examples:
error
(useful for returning custom error
messages)
Existing error:
isValid. While the promise is pending, the
widget will be marked as "in
error". When the promise
resolves, the error is automatically
cleared.
isValid
- isValid
is called right before trying to
persist. This means that even if a
previous promise was already resolved,
when the user hits 'save', isValid
will be called again. If it returns a
new promise, it will be immediately
marked as "in error" until
the new promise resolves.
package.json
that you will have at the end:
webpack.config.js
.babelrc
file is our local
configuration for our code in
the project. You should create
it under the root of the
application repo. It will
affect all files that Babel
processes. So, create a .babelrc
file under the main project
with this content:
src
directory with the files Control.js, Preview.js
and index.js
src/Control.js
src/Preview.js
src/index.js
dev
directory with the files bootstrap.js
and index.js
bootstrap.js
index.js
src
directory, where there are separate
files for the Control
and Preview
components.
package.json
with details for your specific
widget, e.g. name,
description, author, version,
etc.
netlify-cms-widget-<name>.
README.md, rename README_TEMPLATE.md
to README.md, and update the new file for
your specific widget.
src/index.js. For example, if your widget
is netlify-cms-widget-awesome, you would do:
src.
dist: